package com.lsfb.signln.View;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.ajguan.library.ILoadMoreView;
import com.lsfb.signln.R;

/**
 * Created by Administrator on 2018/2/26 0026.
 */

public class SignLoadview extends FrameLayout implements ILoadMoreView {

    private View view;
    private TextView tv;

    public SignLoadview(@NonNull Context context) {
        this(context, null);
    }

    public SignLoadview(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        view = inflate(context, R.layout.item_foot, this);
        tv = view.findViewById(R.id.text);
    }


    @Override
    public void reset() {
        tv.setText("正在重置...");
    }

    @Override
    public void loading() {
        tv.setText("正在加载...");
    }

    @Override
    public void loadComplete() {
        tv.setText("加载完成");
    }

    @Override
    public void loadFail() {
        tv.setText("加载失败,点击重新加载");
    }

    @Override
    public void loadNothing() {
        tv.setText("没有更多数据可加载");
    }

    @Override
    public View getCanClickFailView() {
        return view;
    }
}
